import { _decorator } from 'cc';
import { root } from 'db://delta/root';
import { RootSystem } from './scripts/systems/root_system';
import { MoveSystem } from './scripts/systems/move_system';
import { getEntity } from 'db://delta/ecs/ecs';
import { GebulinEntity } from './scripts/entitys/gebulin_entity';
import { RenderSystem } from './scripts/systems/render_system';
const { ccclass } = _decorator;

@ccclass('delta')
export class Delta extends root {



    start() {
        
        this.ecs.add(new MoveSystem());
        this.ecs.add(new RenderSystem());
        getEntity(GebulinEntity);


        
    }

    update(deltaTime: number) {
        this.ecs.execute(deltaTime);
    }

    init() {
        // 创建持久根节点
     //    director.addPersistRootNode(this.persistRootNode);
        this.ecs = new RootSystem();
        this.ecs.init();
 
     }
}

